package com.chub.study.modules.base;

import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpSession;

/**
 * @author : chub
 * @version : V1.0.0
 * @fileName : SessionUtils.java
 * @description : TODO
 * @createTime : 2024-08-26 14:08
 */
@Service
public class SessionUtils {

    public SessionUtils() {

    }
    public LoginUserInfo getLoginUserInfo(){
        HttpSession httpSession = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()) .getRequest().getSession();
        LoginUserInfo loginUserInfo = (LoginUserInfo) httpSession.getAttribute("login_user_info");
        return loginUserInfo;
    }


}
